﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ERPStore.QuoteCart.Models
{
	[Serializable]
	public class QuoteCart 
	{
		public QuoteCart()
		{
			IsSent = false;
			Items = new List<QuoteCartItem>();
			Code = Guid.NewGuid().ToString().Replace("-", "").Substring(5, 15);
			CreationDate = DateTime.Now;
		}

		public int Id { get; set; }
		public string Code { get; set; }
		public DateTime? ConversionDate { get; set; }
		public int? ConvertedEntityId { get; set; }
		public DateTime CreationDate { get; set; }
		public string CustomerDocumentReference { get; set; }
		public string Message { get; set; }
		public int? CustomerId { get; set; }
		public string LastPage { get; set; }
		public string LeadSourceInfo { get; set; }
		public string LeadSourceId { get; set; }
		public int CartStateId { get; set; }

		public int ItemCount
		{
			get
			{
				return Items.Count;
			}
		}
		public List<QuoteCartItem> Items { get; set; }

		/// <summary>
		/// Indique si le panier de type devis vient d'etre envoyé
		/// </summary>
		/// <value><c>true</c> if this instance is sent; otherwise, <c>false</c>.</value>
		public bool IsSent { get; set; }

		/// <summary>
		/// Gets or sets the visitor id.
		/// </summary>
		/// <value>The visitor id.</value>
		public string VisitorId { get; set; }
	}
}
